package io.netty.example.http.helloworld;

import com.alibaba.fastjson.JSON;
import jdk.nashorn.internal.ir.debug.JSONWriter;

public class JSONSerializer implements Serializer{

    @Override
    public byte[] serialize(Object o) {
        return JSON.toJSONBytes(o);
    }

    @Override
    public <T> T desrialize(Class<T> clazz, byte[] b) {

        return JSON.parseObject(b,clazz);
    }
}
